<template>
	<view>
		<z-paging ref="paging" v-model="dataList" @query="queryList">
			<template>
				<custom-waterfalls-flow :value="dataList" imageKey="img">
					<template v-slot:default="item">
						<view class="item">
							<view class="title">{{item.title}}</view>
							<view class="desc">{{item.content}}</view>
						</view>
					</template>
				</custom-waterfalls-flow>
			</template>
		</z-paging>

		<uni-fab @fabClick="fabClick" />

	</view>
</template>

<script>
	export default {
		data() {
			return {
				dataList: []
				// data: {
				// 	list: [{
				// 			image: 'https://via.placeholder.com/200x500.png/ff0000',
				// 			title: '我是标题1',
				// 			desc: '描述描述描述描述描述描述描述描述1'
				// 		},
				// 		{
				// 			image: 'https://via.placeholder.com/200x200.png/2878ff',
				// 			title: '我是标题2',
				// 			desc: '描述描述描述描述描述描述描述描述2'
				// 		}, {
				// 			image: 'https://via.placeholder.com/200x500.png/ff0000',
				// 			title: '我是标题1',
				// 			desc: '描述描述描述描述描述描述描述描述1'
				// 		},
				// 		{
				// 			image: 'https://via.placeholder.com/200x200.png/2878ff',
				// 			title: '我是标题2',
				// 			desc: '描述描述描述描述描述描述描述描述2'
				// 		}
				// 	]
				// }
			}
		},
		methods: {
			queryList(pageNo, pageSize) {
				uni.$u.http.get('/system/postManage/appList', {
					pageNum: pageNo,
					pageSize: pageSize
				}).then(res => {
					this.$refs.paging.complete(res.rows);
				}).catch(err => {
					this.$refs.paging.complete(false);
				})
			},
			fabClick() {
				uni.navigateTo({
					url: "/pages/post_publish/post_publish"
				})
			},
		}
	}
</script>

<style>

</style>
